package com.bdqn.sj.mapper;

import com.bdqn.sj.pojo.SysRole;
import com.bdqn.sj.pojo.SysUser;
import org.mybatis.spring.SqlSessionTemplate;

import java.util.List;

public class SysUserMapperImpl implements SysUserMapper{

    // mybatis-spring包中提供的实现了SqlSession接口的类，用来操作数据库
    private SqlSessionTemplate sqlSession;

    public SqlSessionTemplate getSqlSession() {
        return sqlSession;
    }

    public void setSqlSession(SqlSessionTemplate sqlSession) {
        this.sqlSession = sqlSession;
    }

    @Override
    public List<SysUser> selectSysUserList(SysUser sysUser) {
        return sqlSession.getMapper(SysUserMapper.class).selectSysUserList(sysUser);
    }

    @Override
    public List<SysUser> getUser() {
        return sqlSession.getMapper(SysUserMapper.class).getUser();
    }

    @Override
    public int add(SysRole sysUser) {
        return 0;
    }

    @Override
    public int del(int id) {
        return 0;
    }
}
